package com.itheima.job.common.mail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Author byZhao
 * @Modify 2021-11-16 23:57
 * @Description <p> </p>
 * <p> Talk is cheap . Show me the code! </p>
 */
@Component
public class MailUtil {

    @Autowired
    JavaMailSender mailSender;

    @Async
    public void sendMail(SimpleMailMessage message){
        System.out.println("sending。。。。"+message);
         mailSender.send(message);
    }




}
